package com.hollycrm.hollysqm.core.vo;

import java.util.Random;

import com.hollycrm.hollysqm.core.target.DocColumn;
import com.hollycrm.hollysqm.entities.TblVocCustcontinfo;
import com.hollycrm.hollysqm.util.Constant;

/**
 * 该类可以对TblVocCustcontinfo实体对象进行包装，使其符合solr文档格式
 * @author jianglong
 * @date 2017年3月10日 下午5:36:06
 */
public class V8DocBean {
	@DocColumn(name="id")
	private String id;
	@DocColumn
	private String serviceType;
	@DocColumn
	private String custcontinfoId;
	@DocColumn
	private String txtContent;
	@DocColumn
	private String txtContentAgent;
	@DocColumn
	private String txtContentUser;
	@DocColumn
	private String acceptTime;
	@DocColumn
	private String satisfication;
	@DocColumn
	private String businessType;		
	@DocColumn
	private String areaCode;
	@DocColumn
	private String callee;
	@DocColumn
	private String caller;
	@DocColumn
	private String year;
	@DocColumn
	private String month;
	@DocColumn
	private String week;
	@DocColumn
	private String day;
	@DocColumn
	private String mobileNo;
	@DocColumn
	private String custArea;
	@DocColumn
	private String custBand;
	@DocColumn
	private String custLevel;
	@DocColumn
	private String recordFile;
	@DocColumn
	private Long recoinfoLength;
	@DocColumn
	private Long silenceLength;
	@DocColumn
	private String userCode;
	@DocColumn
	private String recordLengthRange;
	@DocColumn
	private String silenceLengthRange;
	@DocColumn
	private String emotion;
	@DocColumn
	private String netType;
	@DocColumn
	private String startTime;
	@DocColumn
	private String serviceTypeId;
	@DocColumn
	private String qualityStatus;
//	@DocColumn
//	private String agentCode;
	
	
	public V8DocBean(){
		
	}
	public V8DocBean(TblVocCustcontinfo data){
		this.setId(data.getCustcontinfoId());
		this.setServiceType(data.getServiceType());
		this.setCustcontinfoId(data.getCustcontinfoId());
		this.setTxtContentAgent(data.getTxtContentAgent());
		this.setTxtContentUser(data.getTxtContentUser());
		this.setTxtContent(data.getTxtContent());
		this.setAcceptTime(data.getAcceptTime());
		this.setSatisfication(data.getSatisfication());
		this.setBusinessType(data.getBusinessType());
		this.setAreaCode(data.getAreaCode());
		this.setCallee(data.getCallee());
		this.setCaller(data.getCaller());
		this.setYear(data.getYear());
		this.setMonth(data.getMonth());
		this.setWeek(data.getWeek());
		this.setDay(data.getDay());				
		this.setMobileNo(data.getMobileNo());		
		this.setCustArea(data.getCustArea());
		this.setCustBand(data.getCustBand());
		this.setCustLevel(data.getCustLevel());
//		this.setRecordFile(data.getRecordFile()+""+data.getRecordName());
		this.setRecordFile(data.getRecordFile());
		this.setRecoinfoLength((long) Math.ceil(data.getRecoinfoLength() / (double) 1000));		
		this.setSilenceLength(data.getSilenceLength()!=null?(long) Math.ceil(data.getSilenceLength() / (double) 1000):0);		
		this.setUserCode(data.getUserCode());
//		this.setAgentCode(data.getAgentCode());
		this.setRecordLengthRange(Constant.getRecoinfoLengthRangeCode(data.getRecoinfoLength()));
		this.setSilenceLengthRange(Constant.getSilenceRangeCode(data.getRecoinfoLength(),data.getSilenceLength()!=null?data.getSilenceLength():0));
		this.setEmotion(new Random().nextInt(5)+"");
		this.setNetType(data.getNetType());
		this.setStartTime(data.getAcceptTime());
		this.setServiceTypeId("0");//该字段为分类ID，暂时未用到，默认0
		this.setQualityStatus(data.getQualityStatus());
	}
	
	public TblVocCustcontinfo getVocCustcontinfo(){
		return new TblVocCustcontinfo(custcontinfoId, null,
				  areaCode, userCode, caller, callee,
				  mobileNo, acceptTime, year, month,
				  week, day, custArea, custBand,
				  null, recoinfoLength, silenceLength,
				  null, null, null,
				  null, null,
				  null, null,
				  satisfication, recordFile, txtContent,
				  txtContentUser, txtContentAgent, businessType,
				  serviceType, null, null,
				  null, null, null,
				  null, custLevel, null,
				  null, null, null,
				  null, null,
				  null, qualityStatus);		
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getServiceType() {
		return serviceType;
	}
	public void setServiceType(String serviceType) {
		this.serviceType = serviceType;
	}
	public String getCustcontinfoId() {
		return custcontinfoId;
	}
	public void setCustcontinfoId(String custcontinfoId) {
		this.custcontinfoId = custcontinfoId;
	}
	public String getTxtContent() {
		return txtContent;
	}
	public void setTxtContent(String txtContent) {
		this.txtContent = txtContent;
	}
	public String getTxtContentAgent() {
		return txtContentAgent;
	}
	public void setTxtContentAgent(String txtContentAgent) {
		this.txtContentAgent = txtContentAgent;
	}
	public String getTxtContentUser() {
		return txtContentUser;
	}
	public void setTxtContentUser(String txtContentUser) {
		this.txtContentUser = txtContentUser;
	}
	public String getAcceptTime() {
		return acceptTime;
	}
	public void setAcceptTime(String acceptTime) {
		this.acceptTime = acceptTime;
	}
	public String getSatisfication() {
		return satisfication;
	}
	public void setSatisfication(String satisfication) {
		this.satisfication = satisfication;
	}
	public String getBusinessType() {
		return businessType;
	}
	public void setBusinessType(String businessType) {
		this.businessType = businessType;
	}
	public String getAreaCode() {
		return areaCode;
	}
	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}
	public String getCallee() {
		return callee;
	}
	public void setCallee(String callee) {
		this.callee = callee;
	}
	public String getCaller() {
		return caller;
	}
	public void setCaller(String caller) {
		this.caller = caller;
	}
	public String getYear() {
		return year;
	}
	public void setYear(String year) {
		this.year = year;
	}
	public String getMonth() {
		return month;
	}
	public void setMonth(String month) {
		this.month = month;
	}
	public String getWeek() {
		return week;
	}
	public void setWeek(String week) {
		this.week = week;
	}
	public String getDay() {
		return day;
	}
	public void setDay(String day) {
		this.day = day;
	}
	public String getMobileNo() {
		return mobileNo;
	}
	public void setMobileNo(String mobileNo) {
		this.mobileNo = mobileNo;
	}
	public String getCustArea() {
		return custArea;
	}
	public void setCustArea(String custArea) {
		this.custArea = custArea;
	}
	public String getCustBand() {
		return custBand;
	}
	public void setCustBand(String custBand) {
		this.custBand = custBand;
	}
	public String getCustLevel() {
		return custLevel;
	}
	public void setCustLevel(String custLevel) {
		this.custLevel = custLevel;
	}
	public String getRecordFile() {
		return recordFile;
	}
	public void setRecordFile(String recordFile) {
		this.recordFile = recordFile;
	}
	public Long getRecoinfoLength() {
		return recoinfoLength;
	}
	public void setRecoinfoLength(Long recoinfoLength) {
		this.recoinfoLength = recoinfoLength;
	}
	public Long getSilenceLength() {
		return silenceLength;
	}
	public void setSilenceLength(Long silenceLength) {
		this.silenceLength = silenceLength;
	}
	public String getUserCode() {
		return userCode;
	}
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	public String getRecordLengthRange() {
		return recordLengthRange;
	}
	public void setRecordLengthRange(String recordLengthRange) {
		this.recordLengthRange = recordLengthRange;
	}
	public String getSilenceLengthRange() {
		return silenceLengthRange;
	}
	public void setSilenceLengthRange(String silenceLengthRange) {
		this.silenceLengthRange = silenceLengthRange;
	}
	public String getEmotion() {
		return emotion;
	}
	public void setEmotion(String emotion) {
		this.emotion = emotion;
	}
	public String getNetType() {
		return netType;
	}
	public void setNetType(String netType) {
		this.netType = netType;
	}
	public String getStartTime() {
		return startTime;
	}
	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}
	public String getServiceTypeId() {
		return serviceTypeId;
	}
	public void setServiceTypeId(String serviceTypeId) {
		this.serviceTypeId = serviceTypeId;
	}
	public String getQualityStatus() {
		return qualityStatus;
	}
	public void setQualityStatus(String qualityStatus) {
		this.qualityStatus = qualityStatus;
	}
//	public String getAgentCode() {
//		return agentCode;
//	}
//	public void setAgentCode(String agentCode) {
//		this.agentCode = agentCode;
//	}	
	
}
